package gui;

import classes.Agenda;
import classes.Evento;
import classes.EventoParticipante;
import classes.Servidor;
import classes.Tarefa;
import classes.TarefaServidor;
import controlador.LoginControlador;
import erro.ConexaoException;
import erro.ConsultaException;
import fachada.Fachada;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.event.MouseEvent;
import java.awt.event.WindowEvent;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import javax.swing.text.MaskFormatter;

/**
 *
 * @author Roberta
 */
public class TarefaListarTela extends javax.swing.JFrame {

    /** Creates new form TarefaListarTela */
    public TarefaListarTela() {

        initComponents();
        rdAndamento.setSelected(true);
        rdAbertas.setSelected(true);
        rdAbertosAgenda.setSelected(true);
        rdAtivos.setSelected(true);
        carregarTbTarefa();
        carregarTbEventos();
        carregarServidores();
        carregarTbAgenda();
        //    lbLogado.setText(LoginControlador.nome);
        this.setLocationRelativeTo(null);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        grupoListagem = new javax.swing.ButtonGroup();
        grupoEvento = new javax.swing.ButtonGroup();
        grupoAgenda = new javax.swing.ButtonGroup();
        grupoServidor = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        paneListar = new javax.swing.JTabbedPane();
        abaTarefas = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbTarefaListar = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        rdAtrasadas = new javax.swing.JRadioButton();
        rdTodas = new javax.swing.JRadioButton();
        rdAndamento = new javax.swing.JRadioButton();
        rdNaoIniciadas = new javax.swing.JRadioButton();
        rdConcluidas = new javax.swing.JRadioButton();
        rdExcluidas = new javax.swing.JRadioButton();
        rdIncluídaPeloLogado = new javax.swing.JRadioButton();
        rdResponsavel = new javax.swing.JRadioButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        abaEventos = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbEventos = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        rdAbertas = new javax.swing.JRadioButton();
        rdEncerradas = new javax.swing.JRadioButton();
        rdLogados = new javax.swing.JRadioButton();
        rdTodos = new javax.swing.JRadioButton();
        rdParticipo = new javax.swing.JRadioButton();
        abaServidores = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tbServidores = new javax.swing.JTable();
        jPanel4 = new javax.swing.JPanel();
        rdAtivos = new javax.swing.JRadioButton();
        rdDesabilitados = new javax.swing.JRadioButton();
        rdTodosServidores = new javax.swing.JRadioButton();
        abaAgenda = new javax.swing.JPanel();
        paneFiltroAgenda = new javax.swing.JPanel();
        rdTodosAgenda = new javax.swing.JRadioButton();
        rdAbertosAgenda = new javax.swing.JRadioButton();
        rdFinalizadosAgenda = new javax.swing.JRadioButton();
        rdMinhaAgenda = new javax.swing.JRadioButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        tbAgenda = new javax.swing.JTable();
        lbLogado = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        menuCadastrar = new javax.swing.JMenu();
        menuCadastrarTarefa = new javax.swing.JMenuItem();
        menuCadastrarServidor = new javax.swing.JMenuItem();
        menuCadastrarEvento = new javax.swing.JMenuItem();
        menuAgenda = new javax.swing.JMenuItem();
        menuCadastrarLotacao = new javax.swing.JMenuItem();
        menuCargos = new javax.swing.JMenu();
        menuCadastrarCE = new javax.swing.JMenuItem();
        menuCadastrarCC = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        menuLogar = new javax.swing.JMenuItem();
        menuAlterarSenha = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        menuSair = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Sistema Gerenciador de Atividades");
        addWindowFocusListener(new java.awt.event.WindowFocusListener() {
            public void windowGainedFocus(java.awt.event.WindowEvent evt) {
                formWindowGainedFocus(evt);
            }
            public void windowLostFocus(java.awt.event.WindowEvent evt) {
            }
        });
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jLabel1.setBackground(new java.awt.Color(0, 74, 149));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/cabecalho2.png"))); // NOI18N
        jLabel1.setOpaque(true);

        tbTarefaListar.setAutoCreateRowSorter(true);
        tbTarefaListar.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Cód.", "Data Prevista", "Atividade", "Responsável", "Status"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tbTarefaListar.setToolTipText("Clique 2 vezes para ver detalhes da tarefa selecionada.");
        tbTarefaListar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbTarefaListarMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tbTarefaListar);
        tbTarefaListar.getColumnModel().getColumn(0).setMinWidth(40);
        tbTarefaListar.getColumnModel().getColumn(0).setPreferredWidth(50);
        tbTarefaListar.getColumnModel().getColumn(0).setMaxWidth(65);
        tbTarefaListar.getColumnModel().getColumn(1).setMinWidth(85);
        tbTarefaListar.getColumnModel().getColumn(1).setPreferredWidth(94);
        tbTarefaListar.getColumnModel().getColumn(1).setMaxWidth(100);
        tbTarefaListar.getColumnModel().getColumn(2).setMinWidth(300);
        tbTarefaListar.getColumnModel().getColumn(2).setPreferredWidth(350);
        tbTarefaListar.getColumnModel().getColumn(3).setMinWidth(150);
        tbTarefaListar.getColumnModel().getColumn(3).setPreferredWidth(250);
        tbTarefaListar.getColumnModel().getColumn(4).setMinWidth(45);
        tbTarefaListar.getColumnModel().getColumn(4).setPreferredWidth(60);
        tbTarefaListar.getColumnModel().getColumn(4).setMaxWidth(80);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtros"));

        grupoListagem.add(rdAtrasadas);
        rdAtrasadas.setText("Atrasadas");
        rdAtrasadas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdAtrasadasActionPerformed(evt);
            }
        });

        grupoListagem.add(rdTodas);
        rdTodas.setText("Todas");
        rdTodas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdTodasActionPerformed(evt);
            }
        });

        grupoListagem.add(rdAndamento);
        rdAndamento.setText("Em Andamento");
        rdAndamento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdAndamentoActionPerformed(evt);
            }
        });

        grupoListagem.add(rdNaoIniciadas);
        rdNaoIniciadas.setText("Não Iniciadas");
        rdNaoIniciadas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdNaoIniciadasActionPerformed(evt);
            }
        });

        grupoListagem.add(rdConcluidas);
        rdConcluidas.setText("Concluídas");
        rdConcluidas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdConcluidasActionPerformed(evt);
            }
        });

        grupoListagem.add(rdExcluidas);
        rdExcluidas.setText("Excluídas");
        rdExcluidas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdExcluidasActionPerformed(evt);
            }
        });

        grupoListagem.add(rdIncluídaPeloLogado);
        rdIncluídaPeloLogado.setText("Cadastradas");
        rdIncluídaPeloLogado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdIncluídaPeloLogadoActionPerformed(evt);
            }
        });

        grupoListagem.add(rdResponsavel);
        rdResponsavel.setText("Minhas Tarefas");
        rdResponsavel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdResponsavelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rdConcluidas)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rdAndamento)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rdNaoIniciadas)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rdAtrasadas)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rdExcluidas)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rdTodas)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rdIncluídaPeloLogado)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rdResponsavel)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rdConcluidas)
                    .addComponent(rdAndamento)
                    .addComponent(rdNaoIniciadas)
                    .addComponent(rdExcluidas)
                    .addComponent(rdTodas)
                    .addComponent(rdAtrasadas)
                    .addComponent(rdIncluídaPeloLogado)
                    .addComponent(rdResponsavel)))
        );

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/azul.png"))); // NOI18N
        jLabel2.setText("Não Iniciada.");

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/laranja.png"))); // NOI18N
        jLabel3.setText("Não Iniciada após 24h.");

        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/verde.png"))); // NOI18N
        jLabel4.setText("Iniciada (Em andamento).");

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/amarelo.png"))); // NOI18N
        jLabel5.setText("Iniciada (Em andamento > 50%).");

        jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/vermelho.png"))); // NOI18N
        jLabel6.setText("Atrasada.");

        jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/roxo.png"))); // NOI18N
        jLabel7.setText("Não Iniciada (Atrasada).");

        jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/cinza.png"))); // NOI18N
        jLabel9.setText("Excluída.");

        jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/azulc.png"))); // NOI18N
        jLabel10.setText("Concluída.");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jLabel2)
                .addGap(18, 18, 18)
                .addComponent(jLabel3)
                .addGap(18, 18, 18)
                .addComponent(jLabel7)
                .addGap(18, 18, 18)
                .addComponent(jLabel4)
                .addGap(18, 18, 18)
                .addComponent(jLabel5)
                .addGap(18, 18, 18)
                .addComponent(jLabel6)
                .addGap(18, 18, 18)
                .addComponent(jLabel10)
                .addGap(18, 18, 18)
                .addComponent(jLabel9)
                .addContainerGap(152, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel7)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6)
                    .addComponent(jLabel10)
                    .addComponent(jLabel9))
                .addContainerGap())
        );

        javax.swing.GroupLayout abaTarefasLayout = new javax.swing.GroupLayout(abaTarefas);
        abaTarefas.setLayout(abaTarefasLayout);
        abaTarefasLayout.setHorizontalGroup(
            abaTarefasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(abaTarefasLayout.createSequentialGroup()
                .addGap(150, 150, 150)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(313, Short.MAX_VALUE))
            .addGroup(abaTarefasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
                .addContainerGap())
        );
        abaTarefasLayout.setVerticalGroup(
            abaTarefasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaTarefasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 328, Short.MAX_VALUE)
                .addGap(19, 19, 19)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        paneListar.addTab("Tarefas", abaTarefas);

        tbEventos.setAutoCreateRowSorter(true);
        tbEventos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "Cód.", "Data", "Hora", "Evento", "Local", "Participantes"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tbEventos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbEventosMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tbEventos);
        tbEventos.getColumnModel().getColumn(0).setMinWidth(40);
        tbEventos.getColumnModel().getColumn(0).setPreferredWidth(60);
        tbEventos.getColumnModel().getColumn(0).setMaxWidth(80);
        tbEventos.getColumnModel().getColumn(1).setMinWidth(82);
        tbEventos.getColumnModel().getColumn(1).setPreferredWidth(94);
        tbEventos.getColumnModel().getColumn(1).setMaxWidth(100);
        tbEventos.getColumnModel().getColumn(2).setMinWidth(60);
        tbEventos.getColumnModel().getColumn(2).setPreferredWidth(65);
        tbEventos.getColumnModel().getColumn(2).setMaxWidth(80);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtros"));

        grupoEvento.add(rdAbertas);
        rdAbertas.setText("Abertos");
        rdAbertas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdAbertasActionPerformed(evt);
            }
        });

        grupoEvento.add(rdEncerradas);
        rdEncerradas.setText("Encerrados");
        rdEncerradas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdEncerradasActionPerformed(evt);
            }
        });

        grupoEvento.add(rdLogados);
        rdLogados.setText("Cadastrados");
        rdLogados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdLogadosActionPerformed(evt);
            }
        });

        grupoEvento.add(rdTodos);
        rdTodos.setText("Todos");
        rdTodos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdTodosActionPerformed(evt);
            }
        });

        grupoEvento.add(rdParticipo);
        rdParticipo.setText("Meus Eventos");
        rdParticipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdParticipoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rdAbertas)
                .addGap(18, 18, 18)
                .addComponent(rdEncerradas)
                .addGap(18, 18, 18)
                .addComponent(rdTodos)
                .addGap(18, 18, 18)
                .addComponent(rdLogados)
                .addGap(18, 18, 18)
                .addComponent(rdParticipo)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rdAbertas)
                    .addComponent(rdEncerradas)
                    .addComponent(rdLogados)
                    .addComponent(rdTodos)
                    .addComponent(rdParticipo))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout abaEventosLayout = new javax.swing.GroupLayout(abaEventos);
        abaEventos.setLayout(abaEventosLayout);
        abaEventosLayout.setHorizontalGroup(
            abaEventosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaEventosLayout.createSequentialGroup()
                .addGroup(abaEventosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(abaEventosLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE))
                    .addGroup(abaEventosLayout.createSequentialGroup()
                        .addGap(247, 247, 247)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        abaEventosLayout.setVerticalGroup(
            abaEventosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaEventosLayout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                .addContainerGap())
        );

        paneListar.addTab("Eventos", abaEventos);

        tbServidores.setAutoCreateRowSorter(true);
        tbServidores.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Matricula", "Nome", "CPF", "Telefone", "E-mail"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tbServidores.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbServidoresMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(tbServidores);
        tbServidores.getColumnModel().getColumn(0).setMinWidth(60);
        tbServidores.getColumnModel().getColumn(0).setPreferredWidth(70);
        tbServidores.getColumnModel().getColumn(0).setMaxWidth(90);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtros"));

        grupoServidor.add(rdAtivos);
        rdAtivos.setText("Ativos");
        rdAtivos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdAtivosActionPerformed(evt);
            }
        });

        grupoServidor.add(rdDesabilitados);
        rdDesabilitados.setText("Desabilitados");
        rdDesabilitados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdDesabilitadosActionPerformed(evt);
            }
        });

        grupoServidor.add(rdTodosServidores);
        rdTodosServidores.setText("Todos");
        rdTodosServidores.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdTodosServidoresActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rdAtivos)
                .addGap(18, 18, 18)
                .addComponent(rdDesabilitados)
                .addGap(18, 18, 18)
                .addComponent(rdTodosServidores)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rdAtivos)
                    .addComponent(rdDesabilitados)
                    .addComponent(rdTodosServidores))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout abaServidoresLayout = new javax.swing.GroupLayout(abaServidores);
        abaServidores.setLayout(abaServidoresLayout);
        abaServidoresLayout.setHorizontalGroup(
            abaServidoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaServidoresLayout.createSequentialGroup()
                .addGroup(abaServidoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(abaServidoresLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE))
                    .addGroup(abaServidoresLayout.createSequentialGroup()
                        .addGap(315, 315, 315)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        abaServidoresLayout.setVerticalGroup(
            abaServidoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaServidoresLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)
                .addContainerGap())
        );

        paneListar.addTab("Servidores", abaServidores);

        paneFiltroAgenda.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtros"));

        grupoAgenda.add(rdTodosAgenda);
        rdTodosAgenda.setText("Todos");
        rdTodosAgenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdTodosAgendaActionPerformed(evt);
            }
        });

        grupoAgenda.add(rdAbertosAgenda);
        rdAbertosAgenda.setText("Abertos");
        rdAbertosAgenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdAbertosAgendaActionPerformed(evt);
            }
        });

        grupoAgenda.add(rdFinalizadosAgenda);
        rdFinalizadosAgenda.setText("Finalizados");
        rdFinalizadosAgenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdFinalizadosAgendaActionPerformed(evt);
            }
        });

        grupoAgenda.add(rdMinhaAgenda);
        rdMinhaAgenda.setText("Minha Agenda");
        rdMinhaAgenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdMinhaAgendaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout paneFiltroAgendaLayout = new javax.swing.GroupLayout(paneFiltroAgenda);
        paneFiltroAgenda.setLayout(paneFiltroAgendaLayout);
        paneFiltroAgendaLayout.setHorizontalGroup(
            paneFiltroAgendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(paneFiltroAgendaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rdTodosAgenda)
                .addGap(18, 18, 18)
                .addComponent(rdAbertosAgenda)
                .addGap(18, 18, 18)
                .addComponent(rdFinalizadosAgenda)
                .addGap(18, 18, 18)
                .addComponent(rdMinhaAgenda)
                .addContainerGap(13, Short.MAX_VALUE))
        );
        paneFiltroAgendaLayout.setVerticalGroup(
            paneFiltroAgendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(paneFiltroAgendaLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(paneFiltroAgendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rdTodosAgenda)
                    .addComponent(rdAbertosAgenda)
                    .addComponent(rdFinalizadosAgenda)
                    .addComponent(rdMinhaAgenda)))
        );

        tbAgenda.setAutoCreateRowSorter(true);
        tbAgenda.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "Cód.", "Data", "Hora", "Compromisso", "Local", "Servidor"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tbAgenda.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbAgendaMouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(tbAgenda);
        tbAgenda.getColumnModel().getColumn(0).setMinWidth(40);
        tbAgenda.getColumnModel().getColumn(0).setPreferredWidth(60);
        tbAgenda.getColumnModel().getColumn(0).setMaxWidth(80);
        tbAgenda.getColumnModel().getColumn(1).setMinWidth(84);
        tbAgenda.getColumnModel().getColumn(1).setPreferredWidth(95);
        tbAgenda.getColumnModel().getColumn(1).setMaxWidth(100);
        tbAgenda.getColumnModel().getColumn(2).setMinWidth(65);
        tbAgenda.getColumnModel().getColumn(2).setPreferredWidth(70);
        tbAgenda.getColumnModel().getColumn(2).setMaxWidth(85);

        javax.swing.GroupLayout abaAgendaLayout = new javax.swing.GroupLayout(abaAgenda);
        abaAgenda.setLayout(abaAgendaLayout);
        abaAgendaLayout.setHorizontalGroup(
            abaAgendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaAgendaLayout.createSequentialGroup()
                .addGroup(abaAgendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(abaAgendaLayout.createSequentialGroup()
                        .addGap(343, 343, 343)
                        .addComponent(paneFiltroAgenda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(abaAgendaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)))
                .addContainerGap())
        );
        abaAgendaLayout.setVerticalGroup(
            abaAgendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaAgendaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(paneFiltroAgenda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE)
                .addContainerGap())
        );

        paneListar.addTab("Agenda Pessoal", abaAgenda);

        lbLogado.setForeground(new java.awt.Color(0, 51, 102));

        jMenu1.setText("Opções");
        jMenu1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu1ActionPerformed(evt);
            }
        });

        menuCadastrar.setText("Cadastrar");

        menuCadastrarTarefa.setText("Tarefa");
        menuCadastrarTarefa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCadastrarTarefaActionPerformed(evt);
            }
        });
        menuCadastrar.add(menuCadastrarTarefa);

        menuCadastrarServidor.setText("Servidor");
        menuCadastrarServidor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCadastrarServidorActionPerformed(evt);
            }
        });
        menuCadastrar.add(menuCadastrarServidor);

        menuCadastrarEvento.setText("Evento");
        menuCadastrarEvento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCadastrarEventoActionPerformed(evt);
            }
        });
        menuCadastrar.add(menuCadastrarEvento);

        menuAgenda.setText("Agenda");
        menuAgenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuAgendaActionPerformed(evt);
            }
        });
        menuCadastrar.add(menuAgenda);

        menuCadastrarLotacao.setText("Lotação");
        menuCadastrarLotacao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCadastrarLotacaoActionPerformed(evt);
            }
        });
        menuCadastrar.add(menuCadastrarLotacao);

        menuCargos.setText("Cargo");
        menuCargos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCargosActionPerformed(evt);
            }
        });

        menuCadastrarCE.setText("Efetivo");
        menuCadastrarCE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCadastrarCEActionPerformed(evt);
            }
        });
        menuCargos.add(menuCadastrarCE);

        menuCadastrarCC.setText("Comissão");
        menuCadastrarCC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCadastrarCCActionPerformed(evt);
            }
        });
        menuCargos.add(menuCadastrarCC);

        menuCadastrar.add(menuCargos);

        jMenu1.add(menuCadastrar);
        jMenu1.add(jSeparator1);

        menuLogar.setText("Mudar de usuário");
        menuLogar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuLogarActionPerformed(evt);
            }
        });
        jMenu1.add(menuLogar);

        menuAlterarSenha.setText("Alterar Senha");
        menuAlterarSenha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuAlterarSenhaActionPerformed(evt);
            }
        });
        jMenu1.add(menuAlterarSenha);
        jMenu1.add(jSeparator2);

        menuSair.setText("Sair");
        menuSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuSairActionPerformed(evt);
            }
        });
        jMenu1.add(menuSair);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Sobre");

        jMenuItem1.setText("Versão 1.0");
        jMenu2.add(jMenuItem1);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(paneListar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 1150, Short.MAX_VALUE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 1150, Short.MAX_VALUE)
                    .addComponent(lbLogado))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbLogado)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(paneListar, javax.swing.GroupLayout.DEFAULT_SIZE, 494, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tbTarefaListarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbTarefaListarMouseClicked
        if (evt.getClickCount() == 2) {//se o clique for duplo
            Tarefa t = new Tarefa();
            Fachada f = new Fachada();
            Servidor s = new Servidor();
            int x = tbTarefaListar.getSelectedRow();
            if (evt.getButton() == MouseEvent.BUTTON1) {//e o botão for o esquerdo.
                String id = (String.valueOf(tbTarefaListar.getValueAt(x, 0)));
                TarefaMostrar.mat = (Integer.parseInt(id));
                t.setTarefa_id(TarefaMostrar.mat);
                s.setLogin(LoginControlador.login);
                try {
                    s = f.pesquisarLogin(s);
                    t = f.pesquisar(t);
                } catch (ConexaoException ex) {
                    JOptionPane.showMessageDialog(null, "Não foi possível conectar-se ao banco de dados!\n" + ex);
                } catch (ConsultaException ex) {
                    JOptionPane.showMessageDialog(null, "Ocorreu um erro!\n" + ex);
                }
                TarefaMostrar te = new TarefaMostrar();
                if (LoginControlador.nivel == 2) {
                    if (t.getSolicitante().getMatricula() != s.getMatricula()) {
                        te.btExcluir.setVisible(false);
                        te.btReiniciar.setVisible(false);
                        te.btTarefaConc.setVisible(false);
                        te.btTarefaInic.setVisible(false);
                        te.btAlterar.setVisible(false);
                    }
                }
                if (LoginControlador.nivel == 3) {
                    te.btExcluir.setVisible(false);
                    te.btReiniciar.setVisible(false);
                    te.btTarefaConc.setVisible(false);
                    te.btTarefaInic.setVisible(false);
                    te.btAlterar.setVisible(false);
                    te.btEmail.setVisible(false);
                }
                te.carregarTabela();//Método para carregar a tabela da tela TarefaExibir com os valores da tarefa clicada.
                te.setVisible(true);
            }
        }
    }//GEN-LAST:event_tbTarefaListarMouseClicked

    private void menuCadastrarTarefaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCadastrarTarefaActionPerformed
        TarefaCadastrar tc = new TarefaCadastrar();
        tc.setVisible(true);
    }//GEN-LAST:event_menuCadastrarTarefaActionPerformed

    private void menuLogarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuLogarActionPerformed
        Login l = new Login();
        l.setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_menuLogarActionPerformed

    private void rdTodasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdTodasActionPerformed
        carregarTbTarefa();
    }//GEN-LAST:event_rdTodasActionPerformed

    private void rdConcluidasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdConcluidasActionPerformed
        carregarTbTarefa();
    }//GEN-LAST:event_rdConcluidasActionPerformed

    private void rdAndamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdAndamentoActionPerformed
        carregarTbTarefa();
    }//GEN-LAST:event_rdAndamentoActionPerformed

    private void rdNaoIniciadasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdNaoIniciadasActionPerformed
        carregarTbTarefa();
    }//GEN-LAST:event_rdNaoIniciadasActionPerformed

    private void rdAtrasadasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdAtrasadasActionPerformed
        carregarTbTarefa();
    }//GEN-LAST:event_rdAtrasadasActionPerformed

    private void menuCadastrarServidorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCadastrarServidorActionPerformed
        ServidorCadastrar sc = new ServidorCadastrar();
        sc.setVisible(true);
    }//GEN-LAST:event_menuCadastrarServidorActionPerformed

    private void menuCadastrarEventoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCadastrarEventoActionPerformed
        EventoCadastrar ec = new EventoCadastrar();
        ec.setVisible(true);
    }//GEN-LAST:event_menuCadastrarEventoActionPerformed

    private void menuCadastrarLotacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCadastrarLotacaoActionPerformed
        LotacaoCadastrar lc = new LotacaoCadastrar();
        lc.setVisible(true);
    }//GEN-LAST:event_menuCadastrarLotacaoActionPerformed

    private void menuCargosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCargosActionPerformed
    }//GEN-LAST:event_menuCargosActionPerformed

    private void menuCadastrarCCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCadastrarCCActionPerformed
        CargoComissaoCadastrar cc = new CargoComissaoCadastrar();
        cc.setLocationRelativeTo(null);
        cc.setVisible(true);
    }//GEN-LAST:event_menuCadastrarCCActionPerformed

    private void menuCadastrarCEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCadastrarCEActionPerformed
        CargoEfetivoCadastrar ce = new CargoEfetivoCadastrar();
        ce.setLocationRelativeTo(null);
        ce.setVisible(true);
    }//GEN-LAST:event_menuCadastrarCEActionPerformed

    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenu1ActionPerformed

    private void menuAlterarSenhaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuAlterarSenhaActionPerformed
        AlterarSenha as = new AlterarSenha();
        as.setLocationRelativeTo(null);
        as.setVisible(true);
    }//GEN-LAST:event_menuAlterarSenhaActionPerformed

    private void rdExcluidasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdExcluidasActionPerformed
        carregarTbTarefa();
    }//GEN-LAST:event_rdExcluidasActionPerformed

    private void menuSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuSairActionPerformed
        int selectedOption = JOptionPane.showConfirmDialog(null, "Deseja realmente sair do sistema?", "Sistema informa:", JOptionPane.YES_NO_OPTION);
        if (selectedOption == JOptionPane.YES_OPTION) {
            System.exit(0);
        } else {
            this.repaint();
        }
    }//GEN-LAST:event_menuSairActionPerformed

    private void tbEventosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbEventosMouseClicked
        Evento e = new Evento();
        if (evt.getClickCount() == 2) {//se o clique for duplo           
            EventoMostrar te = new EventoMostrar();
            int x = tbEventos.getSelectedRow(); //Pega o índice da linha selecionada.
            // ArrayList lista = f.listarEvento();//Lista eventos.
            if (evt.getButton() == MouseEvent.BUTTON1) {//e o botão for o esquerdo.
                String id = (String.valueOf(tbEventos.getValueAt(x, 0)));
                EventoMostrar.id = (Integer.parseInt(id));
                e.setEvento_id(EventoMostrar.id);

                if (LoginControlador.nivel == 3) {
                    te.btExcluir.setVisible(false);
                    te.btEmail.setVisible(false);
                    te.btAlterar.setVisible(false);
                }
                te.carregarTabela();//Método para carregar a tabela da tela TarefaExibir com os valores da tarefa clicada.
                te.setVisible(true);
            }
        }
    }//GEN-LAST:event_tbEventosMouseClicked

    private void rdIncluídaPeloLogadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdIncluídaPeloLogadoActionPerformed
        carregarTbTarefa();
    }//GEN-LAST:event_rdIncluídaPeloLogadoActionPerformed

    private void tbServidoresMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbServidoresMouseClicked
        if (evt.getClickCount() == 2) {//se o clique for duplo
            ServidorExibir se = new ServidorExibir();
            int x = tbServidores.getSelectedRow();
            if (evt.getButton() == MouseEvent.BUTTON1) {//e o botão for o esquerdo
                String matr = (String.valueOf(tbServidores.getValueAt(x, 0)));
                matr = matr.replaceAll("[^0-9]", "");
                ServidorExibir.matricula = matr;
                if (LoginControlador.nivel == 3) {
                    se.btAlterar.setVisible(false);
                    se.lbNivel.setVisible(false);
                }
                se.carregarTabela();//Método para carregar a tabela da tela ServidorExibir com os valores do servidor pesquisado.
                se.setVisible(true);
            }
        }
    }//GEN-LAST:event_tbServidoresMouseClicked

    private void formWindowGainedFocus(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowGainedFocus
        carregarTbTarefa();
        carregarTbEventos();
        carregarServidores();
        carregarTbAgenda();
    }//GEN-LAST:event_formWindowGainedFocus

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        if (evt.getID() == WindowEvent.WINDOW_CLOSING) {
            int selectedOption = JOptionPane.showConfirmDialog(null, "Deseja realmente sair do sistema?", "Sistema informa:", JOptionPane.YES_NO_OPTION);
            if (selectedOption == JOptionPane.YES_OPTION) {
                System.exit(0);
            } else {
                this.repaint();
            }
        }
    }//GEN-LAST:event_formWindowClosing

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
    }//GEN-LAST:event_formWindowOpened

    private void rdAbertasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdAbertasActionPerformed
        carregarTbEventos();
    }//GEN-LAST:event_rdAbertasActionPerformed

    private void rdEncerradasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdEncerradasActionPerformed
        carregarTbEventos();
    }//GEN-LAST:event_rdEncerradasActionPerformed

    private void rdTodosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdTodosActionPerformed
        carregarTbEventos();
    }//GEN-LAST:event_rdTodosActionPerformed

    private void rdLogadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdLogadosActionPerformed
        carregarTbEventos();
    }//GEN-LAST:event_rdLogadosActionPerformed

    private void rdParticipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdParticipoActionPerformed
        carregarTbEventos();
    }//GEN-LAST:event_rdParticipoActionPerformed

    private void rdResponsavelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdResponsavelActionPerformed
        carregarTbTarefa();
    }//GEN-LAST:event_rdResponsavelActionPerformed

    private void rdFinalizadosAgendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdFinalizadosAgendaActionPerformed
        carregarTbAgenda();
    }//GEN-LAST:event_rdFinalizadosAgendaActionPerformed

    private void menuAgendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuAgendaActionPerformed
        AgendaCadastrar ac = new AgendaCadastrar();
        ac.setVisible(true);
    }//GEN-LAST:event_menuAgendaActionPerformed

    private void rdTodosAgendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdTodosAgendaActionPerformed
        carregarTbAgenda();
    }//GEN-LAST:event_rdTodosAgendaActionPerformed

    private void rdAbertosAgendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdAbertosAgendaActionPerformed
        carregarTbAgenda();
    }//GEN-LAST:event_rdAbertosAgendaActionPerformed

    private void rdMinhaAgendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdMinhaAgendaActionPerformed
        carregarTbAgenda();
    }//GEN-LAST:event_rdMinhaAgendaActionPerformed

    private void tbAgendaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbAgendaMouseClicked
        Fachada f = new Fachada();
        if (evt.getClickCount() == 2) {//se o clique for duplo  
            int x = tbAgenda.getSelectedRow(); //Pega o índice da linha selecionada.            
            Servidor s = new Servidor();
            s.setLogin(LoginControlador.login);

            AgendaMostrar te = new AgendaMostrar();
            if (evt.getButton() == MouseEvent.BUTTON1) {//e o botão for o esquerdo.
                Agenda a = new Agenda();
                String id = (String.valueOf(tbAgenda.getValueAt(x, 0)));
                AgendaMostrar.id = (Integer.parseInt(id));
                a.setAgenda_id(AgendaMostrar.id);
                te.carregarTabela();
                te.setVisible(true);
            }

        }
    }//GEN-LAST:event_tbAgendaMouseClicked

    private void rdAtivosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdAtivosActionPerformed
        carregarServidores();
    }//GEN-LAST:event_rdAtivosActionPerformed

    private void rdDesabilitadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdDesabilitadosActionPerformed
        carregarServidores();
    }//GEN-LAST:event_rdDesabilitadosActionPerformed

    private void rdTodosServidoresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdTodosServidoresActionPerformed
        carregarServidores();
    }//GEN-LAST:event_rdTodosServidoresActionPerformed

    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TarefaListarTela.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TarefaListarTela.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TarefaListarTela.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TarefaListarTela.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new TarefaListarTela().setVisible(true);
            }
        });
    }

    public final void carregarTbTarefa() {

        DefaultTableModel modelo = (DefaultTableModel) tbTarefaListar.getModel();
        modelo.setNumRows(0);
        Fachada f = new Fachada();
        TarefaServidor tServidor = new TarefaServidor();

        ArrayList<Tarefa> lista = carregarArray();

        for (int i = 0; i < lista.size(); i++) {
            TarefaServidor.tarefa = lista.get(i).getTarefa_id();
            String nomes = "";//String que armazena os nomes dos sevidores da tarefa.
            try {
                ArrayList<TarefaServidor> listaS = (ArrayList<TarefaServidor>) f.listarTs();
                for (int c = 0; c < listaS.size(); c++) {
                    String separador = "";

                    if (listaS.size() != 1) {
                        if (c + 1 == listaS.size()) {
                            separador = "";
                        } else {
                            separador = ", ";
                        }
                    }
                    nomes += listaS.get(c).getNome() + separador;
                }
            } catch (ConexaoException ex) {
                JOptionPane.showMessageDialog(null, "Não foi possível conectar-se ao banco de dados!\n" + ex);
            } catch (ConsultaException e) {
                JOptionPane.showMessageDialog(null, "Ocorreu um erro ao tentar carregar a tabela de Tarefas.\n" + e);
            }

            DateFormat formatdata = new SimpleDateFormat("dd-MM-yyyy");
            Date dataPrev = lista.get(i).getDataPrevista();
            String dataP = (formatdata.format(dataPrev));
            tServidor.setTarefa_id(lista.get(i));

            modelo.addRow(new Object[]{lista.get(i).getTarefa_id(), dataP, lista.get(i).getAtividade(), nomes});
        }
        tbTarefaListar.setModel(modelo);
        setCorTabela();
        setLocalTabela();
    }
    DefaultTableCellRenderer status = new DefaultTableCellRenderer() {

        @Override
        public Component getTableCellRendererComponent(
                JTable table, Object value,
                boolean isSelected, boolean hasFocus,
                int row, int column) {
            super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            ArrayList<Tarefa> lista = new ArrayList<Tarefa>();
            lista = carregarArray();

            for (int i = 0; i < lista.size(); i++) {
                if (lista.get(i).getStatus() == 5) {
                    if (row == i) {
                        setBackground(new Color(255, 146, 120));//Vermelho
                        setHorizontalAlignment(JLabel.CENTER);
                        setForeground(Color.BLACK);
                    }
                } else if (lista.get(i).getStatus() == 4) {
                    if (row == i) {
                        setBackground(new Color(255, 222, 114));//amarelo
                        setHorizontalAlignment(JLabel.CENTER);
                        setForeground(Color.BLACK);
                    }
                } else if (lista.get(i).getStatus() == 3) {
                    if (row == i) {
                        setBackground(new Color(196, 238, 32));//verde
                        setHorizontalAlignment(JLabel.CENTER);
                        setForeground(Color.BLACK);
                    }
                } else if (lista.get(i).getStatus() == 0) {
                    if (row == i) {
                        setBackground(new Color(134, 218, 255));//Azul
                        setHorizontalAlignment(JLabel.CENTER);
                        setForeground(Color.BLACK);
                    }
                } else if (lista.get(i).getStatus() == 1) {
                    if (row == i) {
                        setBackground(new Color(255, 196, 74));
                        setHorizontalAlignment(JLabel.CENTER);//Laranja
                        setForeground(Color.BLACK);
                    }
                } else if (lista.get(i).getStatus() == 2) {
                    if (row == i) {
                        setBackground(new Color(222, 165, 222));
                        setHorizontalAlignment(JLabel.CENTER);//Roxo
                        setForeground(Color.BLACK);
                    }
                } else if (lista.get(i).getStatus() == 6) {
                    if (row == i) {
                        setBackground(new Color(118, 154, 202));//azul claro
                        setHorizontalAlignment(JLabel.CENTER);
                        setForeground(Color.BLACK);
                    }
                } else if (lista.get(i).getStatus() == 7) {
                    if (row == i) {
                        setBackground(new Color(171, 195, 194));//cinza
                        setHorizontalAlignment(JLabel.CENTER);
                        setForeground(Color.BLACK);

                    }
                }
            }
            return this;
        }
    };
    DefaultTableCellRenderer letras = new DefaultTableCellRenderer() {

        @Override
        public void setValue(Object value) {
            setHorizontalAlignment(JLabel.CENTER);
            super.setValue(value);
        }
    };

    public void setCorTabela() {

        TableColumn tc = tbTarefaListar.getColumn("Status");
        tc.setCellRenderer(status);
    }

    public void setStiloTb() {
        TableColumn column = tbEventos.getColumnModel().getColumn(1);
        column.setCellRenderer(corLinha);
    }

    public void setLocalTabela() {
        TableColumn tc = tbTarefaListar.getColumn("Cód.");
        tc.setCellRenderer(letras);
        TableColumn tdf = tbTarefaListar.getColumn("Data Prevista");
        tdf.setCellRenderer(letras);
        TableColumn td = tbEventos.getColumn("Data");
        td.setCellRenderer(letras);
        TableColumn tdh = tbEventos.getColumn("Hora");
        tdh.setCellRenderer(letras);
        TableColumn cod = tbEventos.getColumn("Cód.");
        cod.setCellRenderer(letras);
        TableColumn date = tbEventos.getColumn("Data");
        date.setCellRenderer(letras);
        TableColumn codigoA = tbAgenda.getColumn("Cód.");
        codigoA.setCellRenderer(letras);
        TableColumn dataA = tbAgenda.getColumn("Data");
        dataA.setCellRenderer(letras);

    }

    public ArrayList<Tarefa> carregarArray() {
        Fachada f = new Fachada();
        Tarefa t = new Tarefa();
        ArrayList<Tarefa> lista = new ArrayList<Tarefa>();
        try {
            lista = f.listarTodas();
            if (rdConcluidas.isSelected()) {
                lista = f.listarConcluidas();
            } else if (rdAndamento.isSelected()) {
                lista = f.listar(t);
            } else if (rdTodas.isSelected()) {
                lista = f.listarTodas();
            } else if (rdAtrasadas.isSelected()) {
                lista = f.listarAtrasadas();
            } else if (rdNaoIniciadas.isSelected()) {
                lista = f.listarNaoIniciadas();
            } else if (rdExcluidas.isSelected()) {
                lista = f.listarExcluidas();
            } else if (rdIncluídaPeloLogado.isSelected()) {
                lista = f.listarPorSolicitante();
            } else if (rdResponsavel.isSelected()) {
                lista = f.listarRespansavel();
            }
        } catch (ConexaoException ex) {
            JOptionPane.showMessageDialog(null, "Não foi possível conectar-se ao banco de dados!\n" + ex);
        } catch (ConsultaException ex) {
            JOptionPane.showMessageDialog(null, "Ocorreu um erro ao tentar listar as Tarefas!\n" + ex);
        }
        return lista;
    }

    public final void carregarTbEventos() {
        try {
            Fachada f = new Fachada();
            DefaultTableModel modelo = (DefaultTableModel) tbEventos.getModel();
            modelo.setNumRows(0);
            ArrayList<Evento> lista = new ArrayList<Evento>();
            if (rdAbertas.isSelected()) {
                lista = f.listarAbertos();
            } else if (rdEncerradas.isSelected()) {
                lista = f.listarEncerrados();
            } else if (rdLogados.isSelected()) {
                lista = f.listarLogado();
            } else if (rdTodos.isSelected()) {
                lista = f.listarEvento();
            } else if (rdParticipo.isSelected()) {
                lista = f.listarParticipo();
            }
            for (int i = 0; i < lista.size(); i++) {
                EventoParticipante.id_evento = lista.get(i).getEvento_id();
                String nomes = "";//String que armazena os nomes dos sevidores da tarefa.
                ArrayList<EventoParticipante> listaP = (ArrayList<EventoParticipante>) f.listarP();
                for (int c = 0; c < listaP.size(); c++) {
                    String separador = "";

                    if (listaP.size() != 1) {
                        if (c + 1 == listaP.size()) {
                            separador = "";
                        } else {
                            separador = ", ";
                        }
                    }
                    nomes += listaP.get(c).getNome() + separador;
                }
                DateFormat formatdata = new SimpleDateFormat("dd-MM-yyyy");
                Date data = lista.get(i).getData();
                String datA = (formatdata.format(data));
                DateFormat formathora = new SimpleDateFormat("HH:mm");
                Date horA = lista.get(i).getHora();
                String hora = (formathora.format(horA));

                modelo.addRow(new Object[]{lista.get(i).getEvento_id(), datA, hora + " h", lista.get(i).getEvento(), lista.get(i).getLocal(), nomes});
            }
            tbEventos.setModel(modelo);
            setStiloTb();
        } catch (ConexaoException ex) {
            JOptionPane.showMessageDialog(null, "Não foi possível conectar-se ao banco de dados!\n" + ex);
        } catch (ConsultaException ex) {
            JOptionPane.showMessageDialog(null, "Ocorreu um erro ao tentar carregar a tabela de Eventos!\n" + ex);
        }
    }

    public final void carregarServidores() {
        try {
            tbServidores.getColumnModel().getColumn(0).setPreferredWidth(30);//matricula
            tbServidores.getColumnModel().getColumn(1).setPreferredWidth(100);//nome
            tbServidores.getColumnModel().getColumn(2).setPreferredWidth(110);//cpf
            tbServidores.getColumnModel().getColumn(3).setPreferredWidth(65);//fone
            tbServidores.getColumnModel().getColumn(4).setPreferredWidth(150);//e-mail profissional

            DefaultTableModel modelo = (DefaultTableModel) tbServidores.getModel();
            modelo.setNumRows(0);
            Fachada f = new Fachada();
            Servidor s = new Servidor();
            ArrayList<Servidor> lista = new ArrayList<Servidor>();
            if (rdAtivos.isSelected()) {
                lista = f.listarAtivos();
            } else if (rdDesabilitados.isSelected()) {
                lista = f.listarDesabilitados();
            } else if (rdTodosServidores.isSelected()) {
                lista = f.listar(s);
            }
            for (int i = 0; i < lista.size(); i++) {
                String cpf;
                String matr;
                try {
                    cpf = formatarString(lista.get(i).getCpf(), ("###.###.###-##"));
                    matr = formatarString(String.valueOf(lista.get(i).getMatricula()), ("#####-#"));
                } catch (ParseException ex) {
                    cpf = lista.get(i).getCpf();
                    matr = String.valueOf(lista.get(i).getMatricula());
                }
                modelo.addRow(new Object[]{matr, lista.get(i).getNome(), cpf, lista.get(i).getTelefone1(), lista.get(i).getEmailProf()});
            }
            tbServidores.setModel(modelo);
        } catch (ConexaoException ex) {
            JOptionPane.showMessageDialog(null, "Não foi possível conectar-se ao banco de dados!\n" + ex);
        } catch (ConsultaException ex) {
            JOptionPane.showMessageDialog(null, "Ocorreu um erro ao tentar carregar a tabela de Servidores!\n" + ex);
        }
    }

    public final void carregarTbAgenda() {
        try {

            DefaultTableModel modelo = (DefaultTableModel) tbAgenda.getModel();
            modelo.setNumRows(0);
            Fachada f = new Fachada();
            Servidor s = new Servidor();
            ArrayList<Agenda> lista = new ArrayList<Agenda>();
            if (rdAbertosAgenda.isSelected()) {
                lista = f.listarAbertas();
            } else if (rdFinalizadosAgenda.isSelected()) {
                lista = f.listarFinalizados();
            } else if (rdMinhaAgenda.isSelected()) {
                lista = f.listarLogadoAgenda();
            } else if (rdTodosAgenda.isSelected()) {
                lista = f.listarAgenda();
            }
            for (int i = 0; i < lista.size(); i++) {
                DateFormat formatdata = new SimpleDateFormat("dd-MM-yyyy");
                Date data = lista.get(i).getData();
                String datA = (formatdata.format(data));
                DateFormat formathora = new SimpleDateFormat("HH:mm");
                Date horA = lista.get(i).getHoraI();
                String hora = (formathora.format(horA));
                s.setMatricula(lista.get(i).getLogado().getMatricula());
                s = f.pesquisar(s);
                modelo.addRow(new Object[]{lista.get(i).getAgenda_id(), datA, hora + " h", lista.get(i).getAssunto(), lista.get(i).getLocal(), s.getNome()});
            }
            tbAgenda.setModel(modelo);
        } catch (ConexaoException ex) {
            JOptionPane.showMessageDialog(null, "Não foi possível conectar-se ao banco de dados!\n" + ex);
        } catch (ConsultaException ex) {
            JOptionPane.showMessageDialog(null, "Ocorreu um erro ao tentar carregar a tabela de Servidores!\n" + ex);
        }
    }

    public static String formatarString(String cpf, String mascara) throws ParseException {
        MaskFormatter mf = new MaskFormatter(mascara);
        mf.setValueContainsLiteralCharacters(false);
        return mf.valueToString(cpf);
    }
    DefaultTableCellRenderer corLinha = new DefaultTableCellRenderer() {

        @Override
        public Component getTableCellRendererComponent(
                JTable table, Object value,
                boolean isSelected, boolean hasFocus,
                int row, int column) {
            super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            Fachada f = new Fachada();
            ArrayList<Evento> lista = new ArrayList<Evento>();
            try {
                lista = f.listarEvento();
            } catch (ConexaoException ex) {
                JOptionPane.showMessageDialog(null, "Não foi possível conectar-se ao banco de dados!\n" + ex);
            } catch (ConsultaException ex) {
                JOptionPane.showMessageDialog(null, "Erro!\n" + ex);
            }

            for (int i = 0; i < lista.size(); i++) {
                GregorianCalendar calendar = new GregorianCalendar();
                DateFormat formatdata = new SimpleDateFormat("dd-MM-yyyy");
                Date hoje = calendar.getTime();
                Date data = lista.get(i).getData();
                String dia = (formatdata.format(hoje));
                String dataEvento = (formatdata.format(data));

                if (dataEvento.equals(dia)) {
                    if (row == i) {
                        setFont(new Font("tahoma", Font.BOLD, 11));
                    }
                }
            }
            return this;
        }
    };
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel abaAgenda;
    private javax.swing.JPanel abaEventos;
    private javax.swing.JPanel abaServidores;
    private javax.swing.JPanel abaTarefas;
    private javax.swing.ButtonGroup grupoAgenda;
    private javax.swing.ButtonGroup grupoEvento;
    public javax.swing.ButtonGroup grupoListagem;
    private javax.swing.ButtonGroup grupoServidor;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    public javax.swing.JLabel lbLogado;
    public javax.swing.JMenuItem menuAgenda;
    private javax.swing.JMenuItem menuAlterarSenha;
    public javax.swing.JMenu menuCadastrar;
    private javax.swing.JMenuItem menuCadastrarCC;
    private javax.swing.JMenuItem menuCadastrarCE;
    public javax.swing.JMenuItem menuCadastrarEvento;
    public javax.swing.JMenuItem menuCadastrarLotacao;
    public javax.swing.JMenuItem menuCadastrarServidor;
    public javax.swing.JMenuItem menuCadastrarTarefa;
    public javax.swing.JMenu menuCargos;
    private javax.swing.JMenuItem menuLogar;
    private javax.swing.JMenuItem menuSair;
    private javax.swing.JPanel paneFiltroAgenda;
    private javax.swing.JTabbedPane paneListar;
    private javax.swing.JRadioButton rdAbertas;
    private javax.swing.JRadioButton rdAbertosAgenda;
    public javax.swing.JRadioButton rdAndamento;
    private javax.swing.JRadioButton rdAtivos;
    public javax.swing.JRadioButton rdAtrasadas;
    public javax.swing.JRadioButton rdConcluidas;
    private javax.swing.JRadioButton rdDesabilitados;
    private javax.swing.JRadioButton rdEncerradas;
    public javax.swing.JRadioButton rdExcluidas;
    private javax.swing.JRadioButton rdFinalizadosAgenda;
    public javax.swing.JRadioButton rdIncluídaPeloLogado;
    private javax.swing.JRadioButton rdLogados;
    private javax.swing.JRadioButton rdMinhaAgenda;
    public javax.swing.JRadioButton rdNaoIniciadas;
    private javax.swing.JRadioButton rdParticipo;
    private javax.swing.JRadioButton rdResponsavel;
    public javax.swing.JRadioButton rdTodas;
    private javax.swing.JRadioButton rdTodos;
    private javax.swing.JRadioButton rdTodosAgenda;
    private javax.swing.JRadioButton rdTodosServidores;
    private javax.swing.JTable tbAgenda;
    private javax.swing.JTable tbEventos;
    private javax.swing.JTable tbServidores;
    public javax.swing.JTable tbTarefaListar;
    // End of variables declaration//GEN-END:variables
}
